﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;

using XCode;
using BingZi.HY.Core;

namespace BingZi.HY.Core
{
	/// <summary>
	/// 在线用户表
	/// </summary>
	[Serializable]
	[DataObject]
	[Description("在线用户表")]
	[BindTable("sys_Online", Description = "在线用户表", ConnName = "System")]
	public partial class sys_Online
	{
		#region 属性
		private Int32 _OnlineID;
		/// <summary>
		/// 自动ID
		/// </summary>
		[Description("自动ID")]
		[DataObjectField(false, true, false, 10)]
		[BindColumn(1, "OnlineID", "自动ID", "", "int", 10, 0, false)]
		public Int32 OnlineID
		{
			get { return _OnlineID; }
			set { if (OnPropertyChanging("OnlineID", value)) { _OnlineID = value;   } }
		}

		private String _O_SessionID;
		/// <summary>
		/// 用户SessionID
		/// </summary>
		[Description("用户SessionID")]
		[DataObjectField(true, false, false, 24)]
		[BindColumn(2, "O_SessionID", "用户SessionID", "", "varchar(24)", 0, 0, false)]
		public String O_SessionID
		{
			get { return _O_SessionID; }
			set { if (OnPropertyChanging("O_SessionID", value)) { _O_SessionID = value;   } }
		}

		private String _O_UserName;
		/// <summary>
		/// 用户名
		/// </summary>
		[Description("用户名")]
		[DataObjectField(false, false, false, 20)]
		[BindColumn(3, "O_UserName", "用户名", "", "nvarchar(20)", 0, 0, true)]
		public String O_UserName
		{
			get { return _O_UserName; }
			set { if (OnPropertyChanging("O_UserName", value)) { _O_UserName = value;   } }
		}

		private String _O_Ip;
		/// <summary>
		/// 用户IP地址
		/// </summary>
		[Description("用户IP地址")]
		[DataObjectField(false, false, false, 15)]
		[BindColumn(4, "O_Ip", "用户IP地址", "", "varchar(15)", 0, 0, false)]
		public String O_Ip
		{
			get { return _O_Ip; }
			set { if (OnPropertyChanging("O_Ip", value)) { _O_Ip = value;   } }
		}

		private DateTime _O_LoginTime;
		/// <summary>
		/// 登陆时间
		/// </summary>
		[Description("登陆时间")]
		[DataObjectField(false, false, false, 3)]
		[BindColumn(5, "O_LoginTime", "登陆时间", "", "datetime", 3, 0, false)]
		public DateTime O_LoginTime
		{
			get { return _O_LoginTime; }
			set { if (OnPropertyChanging("O_LoginTime", value)) { _O_LoginTime = value;   } }
		}

		private DateTime _O_LastTime;
		/// <summary>
		/// 最后访问时间
		/// </summary>
		[Description("最后访问时间")]
		[DataObjectField(false, false, false, 3)]
		[BindColumn(6, "O_LastTime", "最后访问时间", "", "datetime", 3, 0, false)]
		public DateTime O_LastTime
		{
			get { return _O_LastTime; }
			set { if (OnPropertyChanging("O_LastTime", value)) { _O_LastTime = value;   } }
		}

		private String _O_LastUrl;
		/// <summary>
		/// 最后请求网站
		/// </summary>
		[Description("最后请求网站")]
		[DataObjectField(false, false, false, 500)]
		[BindColumn(7, "O_LastUrl", "最后请求网站", "", "nvarchar(500)", 0, 0, true)]
		public String O_LastUrl
		{
			get { return _O_LastUrl; }
			set { if (OnPropertyChanging("O_LastUrl", value)) { _O_LastUrl = value;   } }
		}
		#endregion

		#region 获取/设置 字段值
		/// <summary>
		/// 获取/设置 字段值。
		/// 一个索引，基类使用反射实现。
		/// 派生实体类可重写该索引，以避免反射带来的性能损耗
		/// </summary>
		/// <param name="name">字段名</param>
		/// <returns></returns>
		public override Object this[String name]
		{
			get
			{
				switch (name)
				{
					case "OnlineID" : return _OnlineID;
					case "O_SessionID" : return _O_SessionID;
					case "O_UserName" : return _O_UserName;
					case "O_Ip" : return _O_Ip;
					case "O_LoginTime" : return _O_LoginTime;
					case "O_LastTime" : return _O_LastTime;
					case "O_LastUrl" : return _O_LastUrl;
					default: return base[name];
				}
			}
			set
			{
				switch (name)
				{
					case "OnlineID" : _OnlineID = Convert.ToInt32(value); break;
					case "O_SessionID" : _O_SessionID = Convert.ToString(value); break;
					case "O_UserName" : _O_UserName = Convert.ToString(value); break;
					case "O_Ip" : _O_Ip = Convert.ToString(value); break;
					case "O_LoginTime" : _O_LoginTime = Convert.ToDateTime(value); break;
					case "O_LastTime" : _O_LastTime = Convert.ToDateTime(value); break;
					case "O_LastUrl" : _O_LastUrl = Convert.ToString(value); break;
					default: base[name] = value; break;
				}
			}
		}
		#endregion

		#region 字段名
		/// <summary>
		/// 取得在线用户表字段名的快捷方式
		/// </summary>
        [CLSCompliant(false)]
		public class _
		{
			///<summary>
			/// 自动ID
			///</summary>
			public const String OnlineID = "OnlineID";

			///<summary>
			/// 用户SessionID
			///</summary>
			public const String O_SessionID = "O_SessionID";

			///<summary>
			/// 用户名
			///</summary>
			public const String O_UserName = "O_UserName";

			///<summary>
			/// 用户IP地址
			///</summary>
			public const String O_Ip = "O_Ip";

			///<summary>
			/// 登陆时间
			///</summary>
			public const String O_LoginTime = "O_LoginTime";

			///<summary>
			/// 最后访问时间
			///</summary>
			public const String O_LastTime = "O_LastTime";

			///<summary>
			/// 最后请求网站
			///</summary>
			public const String O_LastUrl = "O_LastUrl";
		}
		#endregion
	}
}